package com.prj.ufdm.cloud.ms.core.enums;

/**
 * @author: zhujq
 * @date: 2019/9/20 11:51
 */
public enum ServerTypeEnum {
    /**
     * 认证服务
     */
    AUTH("01", "AUTH"),
    /**
     * 流程服务
     */
    FLOW("02", "FLOW"),
    /**
     * 文件服务
     */
    FILE("03", "FILE"),
    /**
     * 业务服务
     */
    BIZ("04", "BIZ"),

    /**
     * 报表服务
     */
    REPORT("05", "REPORT"),
    /**
     * 档案服务
     */
    ARCHIVE("06", "ARCHIVE"),
    /**
     * 办公服务
     */
    OA("06", "OA"),
    /**
     * WEB服务
     */
    WEB("07", "WEB"),
    /**
     * APP服务
     */
    APP("08", "APP"),
    /**
     * 日志服务
     */
    LOG("20", "LOG");

    private String code;

    private String label;

    public static String getLabelByCode(int code){
        String label = "";
        for (ServerTypeEnum serverTypeEnum : ServerTypeEnum.values()) {
            if(serverTypeEnum.code.equals(code)){
                label = serverTypeEnum.label;
            }
        }
        return label;
    }

    public static String getCodeBylabel(String label){
        String code = null;
        for (ServerTypeEnum serverTypeEnum : ServerTypeEnum.values()) {
            if(serverTypeEnum.label.equalsIgnoreCase(label)){
                code = serverTypeEnum.code;
            }
        }
        return code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    ServerTypeEnum(String code, String label) {
        this.code = code;
        this.label = label;
    }
}
